<?php

use Illuminate\Support\Facades\Route;
use App\Http\Controllers\Admin\AuthController;
use App\Http\Controllers\Admin\IndexController;
use App\Http\Controllers\Admin\BannerController;
use App\Http\Controllers\Admin\TeacherController;
use App\Http\Controllers\Admin\CourseController;
use App\Http\Controllers\Admin\OrderController;
use App\Http\Controllers\Admin\UserController;
use App\Http\Controllers\Admin\CateController;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', function () {
//     return view('welcome');
// });
// Home 模块
Route::namespace('Home')->group(function () {
    // 首页
    Route::get('/', 'IndexController@index');
    Route::get('/shares', 'SharesController@index');
    Route::get('/spider', 'SpiderController@index');
    Route::get('/shenjian', 'ShenjianController@index');
    Route::get('/wlfd', 'WlfdController@index');
    Route::get('/anhour', 'AnhourController@index');
    Route::get('/ten', 'TenController@index');
});
// 后台登录页面
Route::group(['namespace'=>'Admin','prefix'=>'admin','middleware'=>'web'],function (){
    //后台管理员
    Route::any('login', [AuthController::class, 'login'])->name('admin.login');
    Route::any('logout', [AuthController::class, 'logout'])->name('admin.logout');
    //首页
    Route::get('index', [IndexController::class, 'index']);
    Route::get('console', [IndexController::class, 'console']);
    Route::any('upload', [IndexController::class, 'upload'])->name('admin.upload');//原图上传
    Route::any('uploadedit', [IndexController::class, 'uploadedit'])->name('admin.uploadedit');//原图上传
    Route::any('uploads', [IndexController::class, 'uploads'])->name('admin.uploads');//压缩上传
    //轮播图
    Route::get('banner', [BannerController::class, 'banner'])->name('admin.banner');
    Route::get('bannerdata', [BannerController::class, 'bannerdata'])->name('admin.bannerdata');
    Route::any('delbanner', [BannerController::class, 'delbanner'])->name('admin.delbanner');
    Route::any('addbanner', [BannerController::class, 'addbanner'])->name('admin.addbanner');
    Route::any('banner_state_on', [BannerController::class, 'state_on'])->name('admin.banner_state_on');
    Route::any('banner_state_off', [BannerController::class, 'state_off'])->name('admin.banner_state_off');
    Route::any('editbannerup', [BannerController::class, 'editbannerup'])->name('admin.editbannerup');
    Route::any('editbanner/{id?}', [BannerController::class, 'editbanner'])->name('admin.editbanner');
    //名师
    Route::get('teacher', [TeacherController::class, 'teacher'])->name('admin.teacher');
    Route::get('teacherdata',[TeacherController::class, 'teacherdata'])->name('admin.teacherdata');
    Route::any('addteacher',[TeacherController::class, 'addteacher'])->name('admin.addteacher');
    Route::any('editteacher/{id?}',[TeacherController::class, 'editteacher'])->name('admin.editteacher');
    Route::any('editteacherup',[TeacherController::class, 'editteacherup'])->name('admin.editteacherup');
    Route::any('delteacher',[TeacherController::class, 'delteacher'])->name('admin.delteacher');
    Route::any('teacher_state_off',[TeacherController::class, 'state_off'])->name('admin.teacher_state_off');
    Route::any('teacher_state_on',[TeacherController::class, 'state_on'])->name('admin.teacher_state_on');
    Route::any('teacher_recommend_on',[TeacherController::class, 'recommend_on'])->name('admin.teacher_recommend_on');
    Route::any('teacher_recommend_off',[TeacherController::class, 'recommend_off'])->name('admin.teacher_recommend_off');
    //课程
    Route::get('course', [CourseController::class, 'course'])->name('admin.course');
    Route::get('teachers', [CourseController::class, 'teachers'])->name('admin.teachers');
    Route::get('coursedata', [CourseController::class, 'coursedata'])->name('admin.coursedata');
    Route::any('addcourse', [CourseController::class, 'addcourse'])->name('admin.addcourse');
    Route::any('editcourse/{id?}', [CourseController::class, 'editcourse'])->name('admin.editcourse');
    Route::any('editcourseup', [CourseController::class, 'editcourseup'])->name('admin.editcourseup');
    Route::any('delcourse', [CourseController::class, 'delcourse'])->name('admin.delcourse');
    Route::any('course_state_off', [CourseController::class, 'course_state_off'])->name('admin.course_state_off');
    Route::any('course_state_on', [CourseController::class, 'course_state_on'])->name('admin.course_state_on');
    Route::any('course_recommend_on', [CourseController::class, 'course_recommend_on'])->name('admin.course_recommend_on');
    Route::any('course_recommend_off', [CourseController::class, 'course_recommend_off'])->name('admin.course_recommend_off');
    //订单
    Route::get('orders', [OrderController::class, 'orders'])->name('admin.orders');
    Route::get('odata', [OrderController::class, 'odata'])->name('admin.odata');
    //用户
    Route::get('users', [UserController::class, 'users'])->name('admin.users');
    Route::get('udata', [UserController::class, 'udata'])->name('admin.udata');
    //分类
    Route::any('cate', [CateController::class, 'cate'])->name('admin.cate');
    Route::any('cates', [CateController::class, 'cates'])->name('admin.cates');
    Route::any('addcate', [CateController::class, 'addcate'])->name('admin.addcate');
    Route::any('addsubcate/{id?}', [CateController::class, 'addsubcate'])->name('admin.addsubcate');
    Route::any('addsubcateup', [CateController::class, 'addsubcateup'])->name('admin.addsubcateup');
    Route::any('editcate/{id?}', [CateController::class, 'editcate'])->name('admin.editcate');
    Route::any('editcateup', [CateController::class, 'editcateup'])->name('admin.editcateup');
    Route::any('delcate', [CateController::class, 'delcate'])->name('admin.delcate');

    Route::get('tmd', 'TmdController@tmd')->name('admin.tmd');
    Route::get('data', 'TmdController@data')->name('admin.data');
    Route::get('form', 'TmdController@form')->name('admin.form');
    Route::get('operaterule', 'IndexController@operaterule');
});
// 老师后台登录页面
Route::group(['namespace'=>'Customer','prefix'=>'customer','middleware'=>'web'],function (){

    //老师后台管理
    Route::any('login', 'AuthController@login')->name('customer.login');
    Route::any('logout', 'AuthController@logout')->name('customer.logout');
    //首页
    Route::get('index', 'IndexController@index');
    Route::get('console', 'IndexController@console');
    Route::any('upload', 'IndexController@upload')->name('customer.upload');//原图上传
    Route::any('uploadedit', 'IndexController@uploadedit')->name('customer.uploadedit');//原图上传
    Route::any('uploads', 'IndexController@uploads')->name('customer.uploads');//压缩上传
    //课程
    Route::get('course', 'CourseController@course')->name('customer.course');
    Route::get('coursedata', 'CourseController@coursedata')->name('customer.coursedata');
    Route::any('addcourse', 'CourseController@addcourse')->name('customer.addcourse');
    Route::any('editcourse/{id?}', 'CourseController@editcourse')->name('customer.editcourse');
    Route::any('editcourseup', 'CourseController@editcourseup')->name('customer.editcourseup');
    Route::any('delcourse', 'CourseController@delcourse')->name('customer.delcourse');
    Route::any('course_state_off', 'CourseController@state_off')->name('customer.course_state_off');
    Route::any('course_state_on', 'CourseController@state_on')->name('customer.course_state_on');
    Route::any('course_recommend_on', 'CourseController@recommend_on')->name('customer.course_recommend_on');
    Route::any('course_recommend_off', 'CourseController@recommend_off')->name('customer.course_recommend_off');
    //订单
    Route::get('orders', 'OrderController@orders')->name('customer.orders');
    Route::get('odata', 'OrderController@odata')->name('customer.odata');
    //用户
    Route::get('users', 'UserController@users')->name('customer.users');
    Route::get('udata', 'UserController@udata')->name('customer.udata');
});
// Route::group(['namespace'=>'Api','prefix'=>'api','middleware'=>'api'],function (){
//     //首页课程
//     Route::any('course', 'ApiController@course')->name('api.course');
// });